import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import login from './views/login.vue'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home,
      redirect: { name: 'welcome' },
      children: [
        {
          path: 'welcome',
          name: 'welcome',
          // route level code-splitting
          // this generates a separate chunk (welcome.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import(/* webpackChunkName: "welcome" */ './views/Welcome.vue')
        }, {
          path: 'test',
          name: 'test',
          // route level code-splitting
          // this generates a separate chunk (text.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import(/* webpackChunkName: "test" */ './views/test.vue')
        }, {
          path: 'users',
          name: 'users',
          // route level code-splitting
          // this generates a separate chunk (users.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import(/* webpackChunkName: "users" */ './views/Users.vue')
        },
        {
          path: 'roles',
          name: 'roles',
          // route level code-splitting
          // this generates a separate chunk (roles.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import(/* webpackChunkName: "roles" */ './views/auth/roles.vue')
        },
        {
          path: 'Rights',
          name: 'Rights',
          // route level code-splitting
          // this generates a separate chunk (Rights.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import(/* webpackChunkName: "Rights" */ './views/auth/Rights.vue')
        },
        {
          path: 'categories',
          name: 'categories',
          component: () => import(/* webpackChunkName: "categories" */ './views/goods/cate.vue')
        },
        {
          path: 'params',
          name: 'params',
          component: () => import(/* webpackChunkName: "params" */ './views/goods/params.vue')
        },
        {
          path: 'goods',
          name: 'goods',
          component: () => import(/* webpackChunkName: "goods" */ './views/goods/goods.vue')
        }

      ]
    },

    {
      path: '/login',
      name: 'login',
      // eslint-disable-next-line no-undef
      component: login
    }
  ]
})
